import { Link, useLocale, useSiteData } from 'dumi';
import React, { type FC } from 'react';
import { useRouteHome } from '../../../use/useRouteHome';
import './index.less';

const Logo: FC = () => {
  const { themeConfig } = useSiteData();
  const locale = useLocale();

  const { isHome } = useRouteHome();

  return (
    <Link
      className="dumi-default-logo"
      to={'base' in locale ? locale.base : '/'}
    >
      {/* {themeConfig.logo !== false && (
        <img
          src={
            themeConfig.logo ||
            ''
          }
          alt={themeConfig.name}
        />
      )} */}
      <span
        className="logo-text"
        style={
          isHome
            ? {}
            : {
                fontSize: '20px',
              }
        }
      >
        {themeConfig.name}
      </span>
    </Link>
  );
};

export default Logo;
